# -*- coding: utf-8 -*-
#!/usr/bin/env python

from flask_script import Manager, Server
from app import app
from modules.LogManage.loginit import *
from app.models import *


init_logging()
manager = Manager(app)
#import sys
#print sys.path
# manager.add_command("runserver",Server(host="127.0.0.1", port=8094, use_debugger=True))
manager.add_command("runserver",Server(host="0.0.0.0", port=8094, use_debugger=True))

# https://pypi.tuna.tsinghua.edu.cn/simple
# db.create_all()
@manager.shell
def make_shell_context():
    #return dict(app=app,db=db,User=User,UsrX=UserX,UserC=UserC)
    return dict(app=app,db=db,Spiderdb=Spiderdb)

if __name__ == '__main__':
    manager.run()
